{* 
Change logs
- Juen 6, 2011 - support google map
*}
<div class="gadget">
    <div class="linklist quickcontact">
        {if $moduletitle}
        <div class="linklist_title">
            <h3>{$moduletitle}</h3>
        </div>
        {/if}
        {if $numContacts != 0}
    <div>
        {form name=contact action=contact}
            {control type=hidden name=msg value="_Default"}
            <table border = 0 style="width: 100%;">
                <tr>
                    <td style="padding-right: 15px;"><div id="nameControl" class="text control "><label><span class="label">{$_TR.gender}</span></label></div></td>
                    <td><div id="nameControl" class="text control "><label><span class="label">{$_TR.first_name}</span></label></div></td>
                    <td><div id="nameControl" class="text control "><label><span class="label">{$_TR.last_name}</span></label></div></td>
                </tr>
                <tr>
                    <td style="vertical-align: top;">
                        <span class="control">
                        <select name="gender" class="text control">
                            <option value="{$_TR.mr}" selected>{$_TR.mr}</option>
                            <option value="{$_TR.ms}">{$_TR.ms}</option>
                            <option value="{$_TR.mrs}">{$_TR.mrs}</option>
                            <option value="" selected>{$_TR.gender_not_available}</option>
                        </select>
                        </span>
                    </td>
                    <td style="vertical-align: top;">
                        <span class="control">
                        <input type=text size=11 class="control text required" name="first_name" style="width: {if $smarty.const.LANG == "eng_US"}107{else}90{/if}px;">
                        </td>
                    <td style="vertical-align: top; text-align: right; padding-right: 2px;">
                        <span class="control">
                        <input type=text size=12 class="text required contact_lastname" name="last_name" >
                        </span>
                        </td>
                </tr>
            </table>
            <div id="emailControl" class="text control  required email required">
                <label>
                    <div class="label" style="display: inline; float: left; ">{$_TR.email}</div>
                    <input type="text" id="email" name="email" value=""  class="text required email" required="" caption="{$_TR.email}" style="width: 157px; float: right; margin-bottom: 5px;">
                </label>
            </div>
            <div class="clearfix"></div>
            <div id="subjectControl" class="text control  required required">
                <label>
                    <div class="label" style="display: inline; float: left;">{$_TR.telephone}</div>
                    <!--<input type="text" id="subject" name="subject" value="" size="42" class="text required" required="" caption="{$_TR.subject}" style="width: 157px; float: right;">-->
                    <input type="text" id="telephone" name="telephone" value="" size="42" class="text required" required="" caption="{$_TR.subject}" style="width: 157px; float: right;">
                </label>
            </div>
            <div class="clearfix"></div>
            <div id="contact_textareaControl" class="control">
                <label><span class="label">{$_TR.message}</span>
                <textarea class="textarea  required" name="message" rows="3" cols="34" style="width: 290px; height: 45px;"></textarea>
                </label>
            </div>
            {if $conf->use_captcha != 0}{control type=captcha size=38 }{/if}
            <div class="control" align="right">
                <span id="contact_waiting"></span>&nbsp;<input type="submit" class="login_button" style="margin-top: 05px;" id="contact_button" value="{$_TR.send}">
            </div>
        {/form}
        {* Because, we dont build form in normal way, we must call javascript validate*}
{literal}
<script language='javascript'>
    jQuery(document).ready(function(){
        jQuery("#contact_textareaControl > label > textarea").addClass("required");
        jQuery("#captcha_stringControl > label > input").addClass("required");
        jQuery('#contact').validate();
        
        jQuery("#contact_button").click(function(){
            if (jQuery('#contact').valid())
            {
                ajax_loader_show(jQuery("#contact_waiting"));
                jQuery(this).attr("disabled", "disabled").hide();
                jQuery(this).parents("form").submit();
            }
            else
            {
                jQuery("#contact_waiting").html("");
                jQuery(this).removeAttr("disabled").show();
            }
        });
    });
</script>
{/literal}
      </div>
    {else}
        {if $smarty.const.PREVIEW_READONLY == 1 || $permissions.configure == 1}
            {$_TR.no_contacts}<br>
        {/if}
    {/if}

    {permissions level=$smarty.const.UILEVEL_NORMAL}
        {if $permissions.configure == 1}
            <a href="{link action=manage_contacts}">{$_TR.manage_contacts}</a>
        {/if}
    {/permissions}
    </div>
</div>